<template>
    <div>
        <ul>
            <li v-for='i in list'>{{i.name}}</li>
        </ul>
        <page :total='total' @currentP='getCurrent'/>
    </div>
</template>

<script>
import page from '@/components/p7/page'
    export default {
        components:{
            'page':page
        },
        data(){
            return{
                list:[],
                total:0,
                page:1
            }
        },
        methods:{
            getlist(){
                this.$axios.get('pagecates?page='+this.page).then(res=>{
                    this.list = res.data.list
                    this.total = res.data.total
                })
            },
            getCurrent(v){
                this.page = v
                this.getlist()
            }
        },
        mounted(){
            this.getlist()
        }
    }
</script>

<style scoped>

</style>